$def with(form, projs, dest_dropdown, proj_type_text, pager)
$:render.admin.header(scripts=['scripts/libs/jquery.tools.min.js'], css=['admin/css/ui.css'])

<script type="text/javascript">
    $$(function () {
            $$.tools.validator.fn('[name=name]', function (input, value) {
                value = $$.trim(value);
                if (value == '')
                    return '请输入项目名称。';
                return true;
            });
            $$.tools.validator.fn('[name=type]', function (input, value) {
                value = $$.trim(value);
                if (value == '' || value == '0')
                    return '请选择项目类型。';
                return true;
            });
            $$('form').validator();
    });
</script>
<div class="itemtitle">
    <h3>旅行项目</h3>
</div>

<table class="tb tb2">
    <tr>
        <td class="noborder vtop" width="300">
            <form method="post">
            <table class="tb tb2">
                <tr><th><strong>$:form.submit.attrs['html']</strong></th></tr>
                <tr><td class="td27">名称</td></tr>
                <tr>
                    <td class="vtop rowform">$:form.name.render()</td>
                </tr>
                <tr><td class="td27">类型</td></tr>
                <tr>
                    <td class="vtop rowform">$:form.type.render()</td>
                </tr>
                <tr><td class="td27">目的地</td></tr>
                <tr>
                    <td class="vtop rowform">$:dest_dropdown</td>
                </tr>
                <tr>
                    <td>$:form.submit.render()</td>
                </tr>

            </table>
            </form>
        </td>
        <td class="vtop">
            <table class="tb tb2">
                <tr>
                    <td class="partition" colspan="5">已添加的项目</td>
                </tr>
                <tr class="header">
                    <td width="20">&nbsp;</td>
                    <td>名称</td>
                    <td width="70">类型</td>
                    <td width="100">目的地</td>
                    <td width="100" align="center">操作</td>
                </tr>
                $if projs:
                    $for proj in projs:
                        <tr>
                            <td>&nbsp;</td>
                            <td><a href="/admin/proj/edit/$proj.id">$proj.name</a></td>
                            <td>$:proj_type_text(proj.type)</td>
                            <td>$proj.destination</td>
                            <td>灵感[<a href="/admin/afflatus/add/$proj.id">+</a>]</td>
                        </tr>
                $else:
                    <tr>
                        <td colspan="5" class="empty">暂无数据</td>
                    </tr>
                <tr>
                    <td colspan="5" align="right"><div class="pages">$:pager.render()</div></td>
                </tr>
            </table>
        </td>
    </tr>
</table>

$:render.admin.footer()
